package com.zcxx.cotton.pick.domain;



import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 地图元素
 */
@Data
public class PickMapElement implements Serializable {
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long id;
    /** 父级ID */
    private Long parentId;
    /** 名称 */
    private String name;
    /** 类型 */
    private Integer type;
    /** 经纬度信息 */
    private String detail;

    private String category;

    private String comment;

    private Double area;

    private String[] Latlng;

    private List<PickMapElement> children;

    private Integer child;

    private Integer childSum;

    private String tableName;

    private String areaDetail;

    private Integer color;

    //是否有已经采的棉包 0:没有  1：有
    private String mianbao;

    public PickMapElement() {

    }

    public PickMapElement(Long id, Long parentId, String name, Integer type, String detail, String category, String comment) {
        this.id = id;
        this.parentId = parentId;
        this.name = name;
        this.type = type;
        this.detail = detail;
        this.category = category;
        this.comment = comment;

    }

    public static class Builder {
        /** ID */
        private final Long id;
        /** 父级ID */
        private final Long parentId;
        /** 名称 */
        private String name;
        /** 类型 */
        private Integer type;
        /** 经纬度信息 */
        private String detail;
        private String category;

        private String comment;

        private Double area;

        public Builder(Long id, Long parentId)
        {
            this.id = id;
            this.parentId = parentId;
        }
        public Builder name(String name)
        {
            this.name = name;
            return this;
        }
        public Builder type(Integer type)
        {
            this.type = type;
            return this;
        }
        public Builder detail(String detail)
        {
            this.detail = detail;
            return this;
        }
        public Builder category(String category)
        {
            this.category = category;
            return this;
        }
        public Builder comment(String comment)
        {
            this.comment = comment;
            return this;
        }
        public Builder area(Double area)
        {
            this.area = area;
            return this;
        }
        public PickMapElement build() {
            return new PickMapElement(this);
        }
    }
    private PickMapElement(Builder builder) {

        this.id = builder.id;
        this.parentId = builder.parentId;
        this.name = builder.name;
        this.type = builder.type;
        this.detail = builder.detail;
        this.category = builder.category;
        this.comment = builder.comment;
        this.area = builder.area;
    }

}
